﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MenuItem
{
    class Snack:MenuItemBaseClass
    {
        public Snack(string strName, double price):base(strName)
        {
            Price = price;
        }
        double price;

        public double Price
        {
            get { return price; }
            set
            {
                if (value < 0)
                    throw new ArgumentNullException("Wrong price!");
                price = value;
            }
        }

        public override void PrintToConsole()
        {
            Console.WriteLine("{0} - Price: ${1}", Name, Price);
        }

    }
}
